//自己封装的获取节点工具包
module.exports = {
	//获取一个dom节点
	get(s) {
		return document.querySelector(s);
	},
	//获取所有dom节点
	getAll(s) {
		return document.querySelectorAll(s);
	},
	//底部导航tabbar
	tabbar(filename) {
		let html = `
            <a href="index.html" class="${
							filename === "index" ? "active" : ""
						}"><i class="iconfont zp-home"></i>首页</a>
            <a href="sports_course.html" class="${
							filename === "sports" ? "active" : ""
						}"><i class="iconfont zp-facility"></i>运动</a>
            <a href="circle.html" class="${
							filename === "circle" ? "active" : ""
						}"><i class="iconfont zp-circle"></i>圈子</a>
            <a href="mine.html" class="${
							filename === "mine" ? "active" : ""
						}"><i class="iconfont zp-personal"></i>我的</a>
        `;

		this.get(".tabbar").innerHTML = html;
	},

	//头部导航navbar
	navbar(filename) {
		let html = `
		<a href="sports_run.html" class="${filename === "run" ? "active" : ""}">跑步</a>
        <a href="sports_ride.html" class="${
					filename === "ride" ? "active" : ""
				}">骑行</a>
        <a href="sports_course.html" class="${
					filename === "course" ? "active" : ""
				}">课程训练</a>
		`;

		this.get(".navbar").innerHTML = html;
	},
};
